﻿import React, { Component} from 'react'
import PropTypes from 'prop-types'

class PanleWrapper extends Component {
	constructor(props) {
		super(props);
	}
	componentWillReceiveProps(nextProp){
	}
	componentDidUpdate(){
		setTimeout(()=>{
			panelScroll.refresh()
		})
	}
	render() {
		const {clsName, panelName, children, type} = this.props
		if(type==1){
			return (
				<div className={`panel ${clsName}`}>
					<h4 className="panel-hd">{panelName}</h4>
					<div className="panel-bd">
						{children}
					</div>
				</div>
			)
		}
		if(type==2){
			return (
				<div className={`panel panel-theme-emi ${clsName}`}>
					<h4 className="panel-hd">{panelName}</h4>
					<div className="panel-bd">
						{children}
					</div>
				</div>
			)
		}
		
	}
}

PanleWrapper.defaultProps = {
	clsName: "",
	panelName: "panel name",
	type:2
}

export default PanleWrapper

